﻿<%@ Page Title="" Language="C#" MasterPageFile="~/nest2.master" AutoEventWireup="true" CodeBehind="pub.aspx.cs" Inherits="WebApplication1.pub" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<asp:Panel ID="Panel1" runat="server">
<br />
<br />
    <asp:LinkButton ID="LinkButton1" runat="server" Font-Names="Times New Roman" 
        Font-Size="Medium" PostBackUrl="~/addpub.aspx">Add New Publisher Details</asp:LinkButton>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" CellPadding="3" 
        DataKeyNames="pbno" DataSourceID="SqlDataSource1" Height="215px" 
        style="margin-top: 0px" Width="600px">
        <AlternatingRowStyle BackColor="#003300" />
        <Columns>
            <asp:BoundField DataField="pbno" HeaderText="Publisher No" ReadOnly="True" 
                SortExpression="pbno" />
            <asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />
            <asp:BoundField DataField="addr" HeaderText="Address" SortExpression="addr" />
            <asp:BoundField DataField="mail" HeaderText="Email-Id" SortExpression="mail" />
            <asp:BoundField DataField="descr" HeaderText="Description" SortExpression="descr" />
        </Columns>
        <HeaderStyle BackColor="#996633" Font-Names="Times New Roman" 
            Font-Size="Medium" />
        <RowStyle Font-Names="Times New Roman" Font-Size="Medium" />
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [pub]"
        UpdateCommand="UPDATE pub set addr=@addr,mail=@mail,descr=@descr"
        DeleteCommand="DELETE from pub where pbno=pbno">
        </asp:SqlDataSource>

    </asp:Panel>
</asp:Content>
